import request from '@/utils/request';

export async function fakeSubmitForm(params) {
  return request('/api/forms', {
    method: 'POST',
    data: params,
  });
}
// 获取品牌
export async function queryBrand(params) {
  return request('/goods/goodsBrand/list', {
    params,
  });
}
// 获取店铺
export async function queryStoreList(params) {
  return request('/store/store/list');
}
export async function addCommodity(params) {
  return request('/goods/goods', {
    method: 'POST',
    data: params,
  });
}
export async function UploadCommodity(params) {
  return request('/goods/goods', {
    method: 'PUT',
    data: params,
  });
}
export async function UploadCommodityPicture(params, method) {
  return request('/goods/goodsImg', {
    method: method,
    data: params,
  });
}
export async function queryImageList(params) {
  return request(`/goods/goodsImg/list?goodsId=${params}`);
}
export async function uploadCommodityStep(id, step) {
  return request(`/goods/goods/${id}/${step}`, {
    method: 'PUT',
  });
}

export async function uploadField(params, method) {
  return request('/goods/goodsField', {
    method: method,
    data: params,
  });
}
export async function queryCategory() {
  return request('/goods/goodsCategory/list?parent=true');
}
